]> dgit.raspbian.org Git - gnome-shell.git/commit
workspace: Ensure that _createBestLayout() always returns a layout
authorSebastian Keller <skeller@gnome.org>
Tue, 16 Feb 2021 12:37:17 +0000 (13:37 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 16 Feb 2021 21:24:27 +0000 (21:24 +0000)
commitc01973055f994bd6ce89e6790756be3ad5dafebc
tree000b9ed7b2fd842de1e96d53a40c19a90922a96f
parent901ecfb61921909c7fca7e2fb66d6a1e50879bb2
workspace: Ensure that _createBestLayout() always returns a layout

When opening a large number of windows, the computed space and scale for
a layout can become negative due to the per-row/per-column spacing. This
is smaller than the initial values of lastSpace and lastSpace, leading
to a null return which then causes all sorts of other issues resulting
in the workspace becoming invisible.

This change ensures that the function always returns a layout, even if
it may look a bit broken and does not conform to the scale/space
requirements which are impossible to fulfill for the given number of
windows. It's better than displaying nothing, since it allows users to
move/close windows and restore this to a more usable state.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3730

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1685>
js/ui/workspace.js